package com.chapter.sample.answer.controller;

import cn.hutool.core.util.IdUtil;
import com.chapter.sample.answer.exporter.annotations.RedisLimitAnnotation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class RedisLimitController {

    @RequestMapping("/redis/limit/test")
    @RedisLimitAnnotation(key = "redisLimit", permitsPerSecond = 3, expire = 10, msg = "当前访问人数比较多，请稍后再试，自定义提示！")
    public String redisLimit() {
        return "正常业务返回，订单流水：" + IdUtil.simpleUUID();
    }
}
